/*
 * @Author: wangjing wangjin122@qq.com
 * @Date: 2024-02-22 10:14:17
 * @LastEditors: wangjing wangjin122@qq.com
 * @LastEditTime: 2024-02-22 15:08:43
 * @FilePath: \抽象类\index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
/**
 * 抽象类（基类）
 *    abstract 所定义的类
 *    abstract 所定义的方法 都只能描述 不能进行实现
*/
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
// 抽象类不能被实例化
var Vue = /** @class */ (function () {
    function Vue(name) {
        this.name = name;
    }
    Vue.prototype.getName = function () {
        return this.name;
    };
    return Vue;
}());
// 派生类继承抽象类的使用 可以实例化
var React = /** @class */ (function (_super) {
    __extends(React, _super);
    function React() {
        return _super.call(this, '') || this;
    }
    // 抽象类可以在派生类中进行实现
    React.prototype.init = function (name) {
        this.name = name;
    };
    React.prototype.setName = function (name) {
        this.name = name;
    };
    return React;
}(Vue));
var react = new React();
react.setName('名字');
console.log(react.getName());
